package com.xinan.system.meetwx;

import java.util.List;

import com.jfinal.ext.plugin.tablebind.TableBind;
import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

@TableBind(tableName = "tb_meet_record")
public class TbMeetRecord extends Model<TbMeetRecord>{
	
	private static final long serialVersionUID = 1L;
	
    public static final TbMeetRecord dao = new TbMeetRecord();

    //columns START
    private String ID = "id";  //主键
    private String KEY = "key";  //转发业务主键
    private String TYPE = "type";  //业务类型：1 软文 2 课程
    private String COUNTVIEW = "countview";  //浏览量
    private String COUNTTRANSMIT = "counttransmit";  //转发量
    private String COUNTREGIST = "countregist";  //报名量
    private String COUNTATTEND = "countattend";  //浏览量
    private String COUNTPAY = "countpay";  //缴费量
    private String CREATETIME = "createtime";  //创建时间
    private String CREATEID = "createid";  //创建者

    public void setId(int value) {
        set(ID, value);
    }

	public int getId() {
		return get(ID);
	}
    public void setKey(int value) {
        set(KEY, value);
    }

	public int getKey() {
		return get(KEY);
	}
    public void setType(int value) {
        set(TYPE, value);
    }

	public int getType() {
		return get(TYPE);
	}
    public void setCountview(int value) {
        set(COUNTVIEW, value);
    }

	public int getCountview() {
		return get(COUNTVIEW);
	}
    public void setCounttransmit(int value) {
        set(COUNTTRANSMIT, value);
    }

	public int getCounttransmit() {
		return get(COUNTTRANSMIT);
	}
    public void setCountregist(int value) {
        set(COUNTREGIST, value);
    }

	public int getCountregist() {
		return get(COUNTREGIST);
	}
    public void setCountattend(int value) {
        set(COUNTATTEND, value);
    }

	public int getCountattend() {
		return get(COUNTATTEND);
	}
    public void setCountpay(int value) {
        set(COUNTPAY, value);
    }

	public int getCountpay() {
		return get(COUNTPAY);
	}
    public void setCreatetime(String value) {
        set(CREATETIME, value);
    }

	public String getCreatetime() {
		return get(CREATETIME);
	}
    public void setCreateid(int value) {
        set(CREATEID, value);
    }

	public int getCreateid() {
		return get(CREATEID);
	}
	//columns END

    public List<TbMeetRecord> findAll() {
        return find("select * from tb_meet_record");
    }
    /**
     * @param   where
     * @return  Record
     */
    public List<Record> findAlls(String where) {
        String sqlExp = " from tb_meet_record";
        if(StrKit.notBlank(where)){
                sqlExp += " where " + where;
        }
                return Db.find( "select * " +sqlExp );

    }

    public Page<TbMeetRecord> page(int pageNumber, int pageSize, String where) {
        String sqlExp = "from tb_meet_record";
        if(StrKit.notBlank(where)){
            sqlExp += " where " + where;
        }
        return paginate(pageNumber, pageSize, "select *", sqlExp);
    }
}

